from math import sin, cos, radians, sqrt theta0 = input() theta0 = radians(theta0) theta1 = input() theta1 = radians(theta1) theta2 = input() theta2 = radians(theta2) #print theta x = input() y = input() iter = input() z = complex(x,y) print z.real, z.imag for n in range(1,iter): c2 = (n%3)>>1 c1 = (n%3)%2 c0 = 1 - ( ((n%3)&1)^(((n%3)&2)>>1) ) #Trois choix, dépendant du reste de la division de n par 3 theta = c0*theta0 + c1*theta1 + c2*theta2 z1 = (cos(theta)*z-sin(theta))/(sin(theta)*z+cos(theta)) print z1.real, z1.imag z =z1